package com.weiaibenpao.demo.chislim.ui.widget;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.view.View;
import android.widget.TextView;

import com.weiaibenpao.demo.chislim.R;

import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by Administrator on 2018/1/10.
 */

public class ReportSelectDialog extends Dialog {

    public ReportSelectDialog(@NonNull Context context) {
        super(context);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.layout_report_select_dialog);
        ButterKnife.bind(this);
    }


    @OnClick({R.id.tv_sensitive, R.id.tv_ad, R.id.tv_infringement})
    public void onClick(View v) {
        dismiss();
        if (onReportSelectListener != null) {
            TextView textView = (TextView) v;
            onReportSelectListener.onSelected(String.valueOf(textView.getText()));
        }
    }

    public void setOnReportSelectListener(OnReportSelectListener listener) {
        onReportSelectListener = listener;
    }

    private OnReportSelectListener onReportSelectListener;

    public interface OnReportSelectListener {
        void onSelected(String content);
    }
}
